class Person:
    def __init__(self,xingbie,nianling):
        self.xingbie = xingbie
        self.nianling = nianling
    def named(self,name):
        self.name = name
    def toString(self):
        print('我的名字叫{},今年{}岁,性别：{}'.format(self.name,self.nianling,self.xingbie))
    def __del__(self):
        print('---调用析构方法删除对象---')

zhangsan = Person('男','23')
zhangsan.named('张三')
zhangsan.toString()

zhangsan = Person('女','18')
zhangsan.named('赵四')
zhangsan.toString()
del Person
print('程序结束')